package io.jft.doll.weidget

import android.content.Context
import android.os.Parcelable
import android.support.design.widget.TextInputLayout
import android.util.AttributeSet

/**
 * Created by G on 2017/11/17 0017.
 */
class FixToggleTextInputLayout : TextInputLayout {
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

    //修复设置秘密可见的崩溃问题
    override fun onRestoreInstanceState(state: Parcelable?) {
        val origin = isPasswordVisibilityToggleEnabled
        isPasswordVisibilityToggleEnabled = false
        super.onRestoreInstanceState(state)
        isPasswordVisibilityToggleEnabled = origin
    }
}